#include <sys/time.h>
#include <stdio.h>

void main()
{
	struct timeval tp1, tp2;
	gettimeofday(&tp1, NULL);
	
	sleep(3);

	gettimeofday(&tp2, NULL);

	long tmp = (tp2.tv_sec - tp1.tv_sec) * 1000 + tp2.tv_usec - tp1.tv_usec;	

	printf("%ld\n", tmp);
}
